#include <iostream>
#include <stdio.h>
#include <vector>
using namespace std;

bool Find(int target, vector<vector<int> > &array)
{   
    int row=array.size();
    int clomn=array[0].size();
    printf("%d,%d\n",row,clomn);
    int i=row-1,j=clomn-1;

    while(i<row && j>=0)
    {
        if(array[i][j]>target)
        {
            --j;
            continue;
        }
        else
        {
            if(array[i][j]<target)
            {
                ++i;
                continue;
            }
            else
            {
                return true;
            }
        }
    }
    return false;
}

void testFind()
{
    vector<int> v1;
    v1.push_back(1);
    v1.push_back(2);
    v1.push_back(3);
    vector<int> v2;
    v1.push_back(4);
    v1.push_back(5);
    v1.push_back(6);
    vector<int> v3;
    v1.push_back(7);
    v1.push_back(8);
    v1.push_back(9);
    vector<vector<int> > v;
    v.push_back(v1);
    v.push_back(v2);
    v.push_back(v3);
    printf("row:%lu",v.size());
    printf("clomn:%lu",v[0].size()/v.size());
    Find(1,v);
   // printf("ret:%d",ret);
}

int main()
{

    testFind();
    return 0;
}

